XtGem Forum catalog
IFANGT Software Html Php Android Game Script Tips Trick Xtgem Css Windows
Demo




<!--parser:xtscript-->
# The filelist
# Set the paths

# Files path is relative to the root directory
var $path=/nama_folder

# Descriptions path is relative to the current directory
var $descr=/descriptions

# Set the filelist template MUST BE ALL ON 1 LINE
var $template=<img src="/http://ifangt.mobie.in/img/list.png"/>
<div class="dl"><a href=".file_url.">.file_name_parsed.</a></div>
var $template=call htmlspecialchars $val=$template

#Get the filelist
var $filelist=<xt:filelist sort_type="name" sort_dir="desc" folder="$path"
template="||.file_name_base.@@$template##" per_page="3" filter="*.*"/>

# The outer holder
print <div class="xt_list">
@loop

# Get the entry
var $offset=call strpos $haystack=$filelist;$needle=||;$offset=$offset
var $end_file_substring=call strpos $haystack=$filelist;$needle=##;$offset=$offset
var $file_substring=call substr $val=$filelist;$start=($offset+2);$length=($end_file_substring-$offset-2)

# Get the file base name (no file extension)
var $file_name_base_end =call strpos $haystack=$file_substring;$needle=@@;
var $file_name_base=call substr $val=$file_substring;$start=0;$length=$file_name_base_end

# Get the rest of the template
var $list_entry=call substr $val=$file_substring;$start=($file_name_base_end +2);

# Get the content of the description file
var $description=call source $file=$descr/$file_name_base;$html_safe=0;
# Check for body tags
var $description_content_offset=call strpos $haystack=$description;$needle=<body;
# Extract just the content of the body tags
if $description_content_offset
var $description_content_start=call strpos $haystack=$description;$needle=>;$offset=$description_content_offset
var $description_content_end=call strpos $haystack=$description;$needle=</body;$offset=$description_content_offset
var $description=call substr $val=$description;$start=($description_content_start+1);$length=($description_content_end-
$description_content_start-1)
endif

# output the entry change this to suit your needs
print {{
<div class="xt_item">
<div class="xt_description">$description</div>
$list_entry
</div><hr />
}}

# Loop back for next entry
var $offset=call strpos $haystack=$filelist;$needle=||;$offset=($offset+2)
if $offset > 0
goto @loop
endif

# Get the paging code from the filelist
var $paging_code_start=call strrpos $haystack=$filelist;$needle=##
var $paging_code=call substr $val=$filelist;$start=($paging_code_start+2);

# Output the paging code and close the outer holder
print $paging_code </div>

<!--/parser:xtscript-->

Code

Menu